package com.hu.network.task.impl;

import android.content.Context;

import com.alibaba.fastjson.TypeReference;
import com.hu.network.http.bean.BaseRequestBean;
import com.hu.network.http.bean.InnerRequestBean;
import com.hu.network.http.bean.InnerResponseResult;
import com.hu.network.http.request.IHttpRequest;
import com.hu.network.http.request.impl.GetHttpRequestImpl;
import com.hu.network.http.request.impl.JsonGetHttpRequestImpl;
import com.hu.network.task.AbstractTask;

/**
 * 说明：
 *
 * @author ： hucanhua
 * @date ： 2017/10/25
 */
public class SimpleGetTaskImpl extends AbstractTask<String> {

    private final BaseRequestBean requestBean;

    public SimpleGetTaskImpl(Context context, BaseRequestBean requestBean, boolean useHttps, String url, ITaskCallback<String> iTaskCallback) {
        super(context, useHttps, url, iTaskCallback);
        this.requestBean = requestBean;
    }

    @Override
    protected boolean before(InnerResponseResult<String> innerResponseResult) {
        return true;
    }

    @Override
    protected void after(InnerResponseResult<String> innerResponseResult) {

    }

    @Override
    protected IHttpRequest<String> getRequest() {
        return new GetHttpRequestImpl(new InnerRequestBean<>(useHttps, url, requestBean), null, null);
    }
}
